package com.hzit.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;

import lombok.*;

/**
 * <p>
 * 
 * </p>
 *
 * @author hbxfwf
 * @since 2024-02-23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Student implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "sid", type = IdType.AUTO)
    private Long sid;

    private String sname;

    private String sex;

    private Integer age;

    private String addr;

    private Integer cid;

    @TableLogic         // 标识字段为逻辑删除字段，其中0:代表未删除 1：代表己删除
    private Integer deleted;

    @TableField(fill = FieldFill.INSERT)        // 代表在插入数据时，此字段会自动填充
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE) // 代表在插入及修改数据时，此字段会自动填充
    private LocalDateTime updateTime;

    public Student(String sname, String sex, Integer age, String addr, Integer cid) {
        this.sname = sname;
        this.sex = sex;
        this.age = age;
        this.addr = addr;
        this.cid = cid;
    }
}
